package cn.cdut.yiwenqian.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * CdutPostUsers entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CDUT_POST_USERS", catalog = "cdutpostbar")
public class CdutPostUsers implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -6677233374011554159L;
	private Integer unumber;
	private String name;
	private String account;
	private String password;
	private String workNumber;
	private String phoneNumber;
	private String qqNumber;
	private String email;
	private String sex;
	private String image;
	private String userType;
	private String introduction;
	private String isactive;
	private Set<CdutPostAnswers> cdutPostAnswerses = new HashSet<CdutPostAnswers>(
			0);
	private Set<CdutPostTools> cdutPostToolses = new HashSet<CdutPostTools>(0);
	private Set<CdutPostMessages> cdutPostMessagesesForAuther = new HashSet<CdutPostMessages>(
			0);
	private Set<CdutPostNews> cdutPostNewses = new HashSet<CdutPostNews>(0);
	private Set<CdutPostMessages> cdutPostMessagesesForSender = new HashSet<CdutPostMessages>(
			0);
	private Set<CdutPostTitles> cdutPostTitleses = new HashSet<CdutPostTitles>(
			0);

	// Constructors

	/** default constructor */
	public CdutPostUsers() {
	}

	/** minimal constructor */
	public CdutPostUsers(Integer unumber) {
		this.unumber = unumber;
	}

	/** full constructor */
	public CdutPostUsers(Integer unumber, String name, String account,
			String password, String workNumber, String phoneNumber,
			String qqNumber, String email, String sex, String image,
			String userType, String introduction, String isactive,
			Set<CdutPostAnswers> cdutPostAnswerses,
			Set<CdutPostTools> cdutPostToolses,
			Set<CdutPostMessages> cdutPostMessagesesForAuther,
			Set<CdutPostNews> cdutPostNewses,
			Set<CdutPostMessages> cdutPostMessagesesForSender,
			Set<CdutPostTitles> cdutPostTitleses) {
		this.unumber = unumber;
		this.name = name;
		this.account = account;
		this.password = password;
		this.workNumber = workNumber;
		this.phoneNumber = phoneNumber;
		this.qqNumber = qqNumber;
		this.email = email;
		this.sex = sex;
		this.image = image;
		this.userType = userType;
		this.introduction = introduction;
		this.isactive = isactive;
		this.cdutPostAnswerses = cdutPostAnswerses;
		this.cdutPostToolses = cdutPostToolses;
		this.cdutPostMessagesesForAuther = cdutPostMessagesesForAuther;
		this.cdutPostNewses = cdutPostNewses;
		this.cdutPostMessagesesForSender = cdutPostMessagesesForSender;
		this.cdutPostTitleses = cdutPostTitleses;
	}

	// Property accessors
	@Id
	@GeneratedValue(generator="userIdGenerator")
	@GenericGenerator(name="userIdGenerator",strategy="increment")
	@Column(name = "unumber", unique = true, nullable = false)
	public Integer getUnumber() {
		return this.unumber;
	}

	public void setUnumber(Integer unumber) {
		this.unumber = unumber;
	}

	@Column(name = "name", length = 32)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "account", length = 16)
	public String getAccount() {
		return this.account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name = "password", length = 16)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "workNumber", length = 12)
	public String getWorkNumber() {
		return this.workNumber;
	}

	public void setWorkNumber(String workNumber) {
		this.workNumber = workNumber;
	}

	@Column(name = "phoneNumber", length = 12)
	public String getPhoneNumber() {
		return this.phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	@Column(name = "qqNumber", length = 12)
	public String getQqNumber() {
		return this.qqNumber;
	}

	public void setQqNumber(String qqNumber) {
		this.qqNumber = qqNumber;
	}

	@Column(name = "email", length = 32)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "sex", length = 8)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "image", length = 128)
	public String getImage() {
		return this.image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	@Column(name = "userType", length = 1)
	public String getUserType() {
		return this.userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	@Column(name = "introduction", length = 128)
	public String getIntroduction() {
		return this.introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	@Column(name = "isactive", length = 1)
	public String getIsactive() {
		return this.isactive;
	}

	public void setIsactive(String isactive) {
		this.isactive = isactive;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostUsers")
	public Set<CdutPostAnswers> getCdutPostAnswerses() {
		return this.cdutPostAnswerses;
	}

	public void setCdutPostAnswerses(Set<CdutPostAnswers> cdutPostAnswerses) {
		this.cdutPostAnswerses = cdutPostAnswerses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostUsers")
	public Set<CdutPostTools> getCdutPostToolses() {
		return this.cdutPostToolses;
	}

	public void setCdutPostToolses(Set<CdutPostTools> cdutPostToolses) {
		this.cdutPostToolses = cdutPostToolses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostUsersByAuther")
	public Set<CdutPostMessages> getCdutPostMessagesesForAuther() {
		return this.cdutPostMessagesesForAuther;
	}

	public void setCdutPostMessagesesForAuther(
			Set<CdutPostMessages> cdutPostMessagesesForAuther) {
		this.cdutPostMessagesesForAuther = cdutPostMessagesesForAuther;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostUsers")
	public Set<CdutPostNews> getCdutPostNewses() {
		return this.cdutPostNewses;
	}

	public void setCdutPostNewses(Set<CdutPostNews> cdutPostNewses) {
		this.cdutPostNewses = cdutPostNewses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostUsersBySender")
	public Set<CdutPostMessages> getCdutPostMessagesesForSender() {
		return this.cdutPostMessagesesForSender;
	}

	public void setCdutPostMessagesesForSender(
			Set<CdutPostMessages> cdutPostMessagesesForSender) {
		this.cdutPostMessagesesForSender = cdutPostMessagesesForSender;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdutPostUsers")
	public Set<CdutPostTitles> getCdutPostTitleses() {
		return this.cdutPostTitleses;
	}

	public void setCdutPostTitleses(Set<CdutPostTitles> cdutPostTitleses) {
		this.cdutPostTitleses = cdutPostTitleses;
	}

}